package com.utooo.controller;


import com.utooo.constant.ResultCodeConstant;
import com.utooo.pojo.dto.common.CreateGroup;
import com.utooo.pojo.dto.common.RestResult;
import com.utooo.pojo.dto.purchase.NextNoGetByTypeDto;
import com.utooo.service.purchase.NextNoGetService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: TODO
 * @Author SJD
 * @Date: 2025/4/28 15:42
 * @Copyright: 南京优通信息科技股份有限公司
 */
@Tag(name = "获取数据编号的下一个编号")
@RequestMapping("/nextno")
@RestController
@RequiredArgsConstructor
public class NextNoGetController {

    private final NextNoGetService nextNoGetServiceImpl;
    @RequestMapping(value = "/getNextNo", method = RequestMethod.POST)
    @Operation(summary = "获取下一个整改编号")
    @ResponseBody
    public RestResult<String> getNextNo(@RequestBody @Validated(CreateGroup.class) NextNoGetByTypeDto param) {
        String result = nextNoGetServiceImpl.getNextNo(param);
        return new RestResult<>(ResultCodeConstant.CODE_200, ResultCodeConstant.CODE_200_MSG, result);
    }

}
